def binarySearch(numbers, number): 
    first = 0 
    last = len(numbers) - 1 
    found = False 
    count = 0 
    while first <= last and not found: 
        count += 1
        midpoint = (first + last) // 2 
        if numbers[midpoint] == number: 
            found = True 
        else: 
            if number < numbers[midpoint]: 
                last = midpoint - 1 
            else: 
                first = midpoint + 1 
    return count
    
# === DO NOT modify the code below ===
def main():
    a = [ eval(x) for x in input().split() ]
    n = eval(input())
    print(binarySearch(a,n))
    
if __name__ == '__main__':
    main()
# === DO NOT modify the code above ===